<template>
  <div class="report-tool-wrapper">
    <a-spin :spinning="loading">
      <tabs
        :defaultTagId="defaultTagId"
        :custom="false"
        :tabPaneData="tabPaneData"
        @change="callback"
      ></tabs>
      <main-component
        :defaultTagName="defaultTagName"
        :defaultTagId="defaultTagId"
        :filterData="filterData"
        @searchRes="searchRes"
        @outputData="outputData"
        :lang='lang'
      ></main-component>
      <div class="report-review" v-if="defaultTagName === $t('reportTool.title.monthlyProjectSynthesis')">
        <deptMonthProjectSynthesis ref="monthlyProjectSynthesis" :tableData="tableData" :statistical="statistical" :loading="false"></deptMonthProjectSynthesis>
      </div>
      <div class="report-review" v-else-if="defaultTagName === $t('reportTool.title.projectDeliverables')"></div>
      <!-- <div class="report-review" v-else-if="defaultTagName === $t('reportTool.title.projectFullNode')"></div> -->
      <div class="report-review" v-else>
        <reportTable :ref="componentsName" :tableData="tableData" :loading="false" :columns="columnsDataList.length ? columnsDataList[0][componentsName] : columnsDataList"></reportTable>
      </div>
    </a-spin>
    <a-modal :title="defaultTagName" :visible="visible" @cancel="visible = false" :footer="null">
      <p>{{msgRes}}</p>
    </a-modal>
  </div>
</template>
<script>
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
import tabs from "@/components/tabs/tabs";
import mainComponent from "./mainComponent";
import reportTable from "./reportTable";
import deptMonthProjectSynthesis from "./deptMonthProjectSynthesis";
import {  tabPaneData,columnsData,getProjectNodesList,getDepartmentMonthlyConsolidatedList,
          departmentMonthlyConsolidatedDownload,exportAllNodes,exportAllDelivers,
          getProjectIssueList,getProjectRiskList,getSpecificationIndexList,
          getDepartmentalPerformanceList,getProjectChangeRequesList,
          getPlanningProjectList, 
          getProjectConsolidatedList,
          getProjectDesignRepairList,
          getProjectQualityList,
          getProjectIndexList} from "./configData";
import { saveFile } from '@/utils/util'
import {exportList} from "@/api/projectManage.js"
import { tab1,tab2,tab3,tab4,tab5,tab6,tab7,tab8,tab9,tab10,tab11,tab12 } from './dataBase.js'
export default {
  components: {
    tabs,
    mainComponent,
    reportTable,
    deptMonthProjectSynthesis,
  },
  data() {
    return {
      locale,
      defaultTagId: "projectQuestion",
      defaultTagName: "项目问题",
      filterData: [],
      columnData: [],
      tableData: [],
      columnWidth: 40,
      // tabPaneData,
      visible:false,
      msgRes:'',
      statistical:{},
      loading:false,
      componentsName:'',
      columnsDataList:[],
      lang: '' || 'zh',
    };
  },
  watch:{
     tabPaneData(){
      let tabPaneDataObj = {};
      this.tabPaneData.forEach((item) => {
        tabPaneDataObj[item.tagId] = item;
      });
      this.tabPaneDataObj = tabPaneDataObj;
      this.setData();
    },
    '$store.state.i18nData.lang':function(v){
      this.lang = v
    }
  },
  mounted() {
    let tabPaneDataObj = {};
    this.tabPaneData.forEach((item) => {
      // if (this.lang === 'zh') {
      //   this.$set(item, 'tagName', item['displayName'])
      // } else {
      //   this.$set(item, 'tagName', item['tagEnName'])
      // }
      tabPaneDataObj[item.tagId] = item;
    });
    this.tabPaneDataObj = tabPaneDataObj;
    this.setData();
  },
  computed:{
    tabPaneData(){
      return [
        {
          tagId: 'projectQuestion',
          tagName: this.$t('reportTool.title.projectQuestion'),
          tagEnName:'projectQuestion',
          filterData: [
            {
              name: this.$t('reportTool.condition.selectData'),
              formType: 'DateRange',
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            }
          ],
          columnWidth: 30,
          columnData: [
            {
              displayName: '问题描述',
              name: 'questionDesc',
              key: 'questionDesc'
            },
            {
              displayName: '初步整改方案',
              name: 'actions',
              key: 'actions'
            },
            {
              displayName: '责任人',
              name: 'zp',
              key: 'zp'
            },
            {
              displayName: '提出人',
              name: 'tp',
              key: 'tp'
            },
          ]
        },
        {
          tagId: 'projectRisk',
          tagName: this.$t('reportTool.title.projectRisk'),
          tagEnName:'projectRisk',
          filterData: [
            {
              name: this.$t('reportTool.condition.selectData'),
              formType: 'DateRange',
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            },
          ]
        },
        {
          tagId: 'planningProject',
          tagName: this.$t('reportTool.title.planningProject'),
          tagEnName:'planningProject',
          filterData: [
            {
              name: this.$t('reportTool.condition.division'),
              formType: 'select',
              selects: [],
              value:'',
            },
            {
              name: this.$t('reportTool.condition.researchInstitute'),
              formType: 'select',
              selects: [],
              value:'',
            },
            {
              name: this.$t('reportTool.condition.planningYear'),
              formType: 'DateYear',
              value:this.getNowFormatDate('y').toString()
            }
          ]
        },
        {
          tagId: 'temporaryIndicators',
          tagName: this.$t('reportTool.title.temporaryIndicators'),
          tagEnName:'temporaryIndicators',
          filterData: [
            {
              name: this.$t('reportTool.condition.projectCategory'),
              formType: 'select',
              selects: [],
              multiple:true,
              value:[],
            },
            {
              name: this.$t('reportTool.condition.indicatorCategory'),
              formType: 'select',
              selects: [],
              multiple:true,
              value:[],
            },
            {
              multiple: true,
              name: this.$t('reportTool.condition.selectDepartment'),
              selects: [],
              formType: 'select',
              value:[],
            }
          ]
        },
        {
          tagId: 'projectNode',
          tagName: this.$t('reportTool.title.projectNode'),
          tagEnName:'projectNode',
          filterData: [
            {
              formType: 'select',
              name: this.$t('reportTool.condition.projectCategory'),
              multiple:true,
              value:[],
              selects: [],
            },
            {
              name: this.$t('reportTool.condition.projectSubCategory'),
              formType: 'select',
              selects: [],
              multiple:true,
              value:[],
            },
            {
              formType: 'select',
              name: this.$t('reportTool.condition.selectDepartment'),
              multiple: true,
              selects: [],
              value:[],
            },
            {
              formType: 'DateRange',
              name: this.$t('reportTool.condition.selectData'),
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            }
          ]
        },
        {
          tagId: 'monthlyProjectSynthesis',
          tagName: this.$t('reportTool.title.monthlyProjectSynthesis'),
          tagEnName:'monthlyProjectSynthesis',
          filterData: [
            {
              name: this.$t('reportTool.condition.selectDepartment'),
              formType: 'select',
              multiple: true,
              selects: [],
              value:[],
            },
            {
              name: this.$t('reportTool.condition.selectData'),
              formType: 'DateMonth',
              value:this.getNowFormatDate('m'),
            }
          ]
        },
        {
          tagId: 'projectSynthesis',
          tagName: this.$t('reportTool.title.projectSynthesis'),
          tagEnName:'projectSynthesis',
          filterData: [
            {
              formType: 'select',
              name: this.$t('reportTool.condition.projectCategory'),
              multiple:true,
              value:[],
              selects: [],
            },
            {
              name:  this.$t('reportTool.condition.importanceLevel'),
              formType: 'select',
              selects: [],
              multiple:true,
              value:[],
            },
            {
              formType: 'select',
              name: this.$t('reportTool.condition.projectStatus'),
              selects: [],
              multiple:true,
              value:[],
            },
            {
              formType: 'DateRange',
              name: this.$t('reportTool.condition.selectData'),
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            },
            {
              name: this.$t('reportTool.condition.selectDepartment'),
              formType: 'select',
              multiple: true,
              selects: [],
              value:[],
            }
          ]
        },
        {
          tagId: 'designRepair',
          tagName: this.$t('reportTool.title.designRepair'),
          tagEnName:'designRepair',
          filterData: [
            {
              name: this.$t('reportTool.condition.projectCategory'),
              formType: 'select',
              multiple:true,
              value:[],
              selects: [],
            },
            {
              name: this.$t('reportTool.condition.projectName'),
              selects: [],
              value:'',
              formType: 'text',
            },
            {
              name: this.$t('reportTool.condition.projectStatus'),
              selects: [],
              multiple:true,
              value:[],
              formType: 'select',
            },
            {
              name: this.$t('reportTool.condition.selectData'),
              formType: 'DateRange',
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            },
            {
              name: this.$t('reportTool.condition.selectDepartment'),
              formType: 'select',
              multiple: true,
              selects: [],
              value:[],
            }
          ]
        },
        {
          tagId: 'departmentPerformance',
          tagName: this.$t('reportTool.title.departmentPerformance'),
          tagEnName:'departmentPerformance',
          filterData: [
            {
              formType: 'DateRange',
              name: this.$t('reportTool.condition.selectData'),
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            },
            {
              name: this.$t('reportTool.condition.selectDepartment'),
              formType: 'select',
              selects: [],
              multiple:true,
              value:[],
            }
          ]
        },
        {
          tagId: 'projectChange',
          tagName: this.$t('reportTool.title.projectChange'),
          tagEnName:'projectChange',
          filterData: [
            {
              name: this.$t('reportTool.condition.projectCategory'),
              multiple:true,
              value:[],
              formType: 'select',
              selects: [],
            },
            {
              name: this.$t('reportTool.condition.changeType'),
              formType: 'select',
              selects: [],
              multiple:true,
              value:[],
            },
            {
              name: this.$t('reportTool.condition.changeStatus'),
              formType: 'select',
              selects: [],
              multiple:true,
              value:[],
            },
            {
              name: this.$t('reportTool.condition.selectData'),
              formType: 'DateRange',
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            },
            {
              name: this.$t('reportTool.condition.selectDepartment'),
              multiple:true,
              value:[],
              formType: 'select',
              selects: [],
            }
          ]
        },
        {
          tagId: 'projectQuality',
          tagName: this.$t('reportTool.title.projectQuality'),
          tagEnName:'projectQuality',
          filterData: [
            {
              formType: 'select',
              selects: [],
              name: this.$t('reportTool.condition.projectCategory'),
              multiple:true,
              value:[],
            },
            {
              name: this.$t('reportTool.condition.importanceLevel'),
              selects: [],
              multiple:true,
              value:[],
              formType: 'select',
            },
            {
              name: this.$t('reportTool.condition.projectStatus'),
              formType: 'select',
              selects: [],
              multiple:true,
              value:[],
            },
            {
              name: this.$t('reportTool.condition.selectData'),
              formType: 'DateRange',
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            },
            {
              name: this.$t('reportTool.condition.selectDepartment'),
              formType: 'select',
              selects: [],
              value:[],
              multiple:true,
            }
          ]
        },
        {
          tagId: 'projectIndexDetails',
          tagName: this.$t('reportTool.title.projectIndexDetails'),
          tagEnName:'projectIndexDetails',
          filterData: [
            {
              selects: [],
              name: this.$t('reportTool.condition.projectCategory'),
              formType: 'select',
              value:[],
              multiple:true,
            },
            {
              name: this.$t('reportTool.condition.selectData'),
              formType: 'DateRange',
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            },
            {
              name: this.$t('reportTool.condition.selectDepartment'),
              multiple: true,
              selects: [],
              formType: 'select',
              value:[],
            }
          ]
        },
        {
          tagId: 'projectFullNode',
          tagName: this.$t('reportTool.title.projectFullNode'),
          tagEnName:'projectFullNode',
          filterData: [
            {
              formType: 'select',
              name: this.$t('reportTool.condition.projectCategory'),
              selects: [],
              value:[],
              multiple:true,
            },
            {
              value:'',
              name: this.$t('reportTool.condition.projectName'),
              formType: 'text',
              selects: [],
            },
            {
              name: this.$t('reportTool.condition.selectData'),
              formType: 'DateRange',
              value:[this.getNowFormatDate('d'),this.getNowFormatDate('d')],
            },
            {
              multiple: true,
              name: this.$t('reportTool.condition.selectDepartment'),
              formType: 'select',
              selects: [],
              value:[],
            }
          ]
        },
        {
          tagId: 'projectDeliverables',
          tagName: this.$t('reportTool.title.projectDeliverables'),
          tagEnName:'projectDeliverables',
          filterData: [
            {
              selects: [],
              name: this.$t('reportTool.condition.projectCategory'),
              formType: 'select',
              value:[],
              multiple:true,
            },
            {
              name: this.$t('reportTool.condition.projectName'),
              selects: [],
              value:'',
              formType: 'text',
            },
            {
              name: this.$t('reportTool.condition.selectDepartment'),
              formType: 'select',
              multiple: true,
              selects: [],
              value:[],
            }
          ]
        },
      ];
    },
    columnsData(){
      return [{
        //项目问题
        projectQuestion:[
          {
            url: true,
            name:'projectShortName',
            displayName: this.$t('reportTool.projectQuestion.projectShortName'),
            dataIndex:'projectShortName',
            key: 'projectShortName',
            scopedSlots: {
              customRender: "projectShortName",
            },
          },
          {
            dataIndex:'projectName',
            name:'projectName',
            key: 'projectName',
            displayName: this.$t('reportTool.projectQuestion.projectName'),
            ellipsis: true,
          },
          {
            key: 'projectIssueName',
            dataIndex:'projectIssueName',
            name:'projectIssueName',
            ellipsis: true,
            displayName: this.$t('reportTool.projectQuestion.projectIssueName'),
          },
          {
            name:'issueStatus',
            displayName: this.$t('reportTool.projectQuestion.issueStatus'),
            key: 'issueStatus',
            dataIndex:'issueStatus',
            ellipsis: true,
          },
          {
            key: 'createName',
            name:'createName',
            dataIndex:'createName',
            displayName: this.$t('reportTool.projectQuestion.createName'),
            
            ellipsis: true,
          },
          {
            key: 'createNo',
            name:'createNo',
            dataIndex:'createNo',
            displayName: this.$t('reportTool.projectQuestion.createNo'),
            ellipsis: true,
          },
          {
            name:'createDate',
            dataIndex:'createDate',
            displayName: this.$t('reportTool.projectQuestion.createDate'),
            key: 'createDate',
            ellipsis: true,
          },
          {
            dataIndex:'expectedSolutionDate',
            key: 'expectedSolutionDate',
            displayName: this.$t('reportTool.projectQuestion.solutionDate'),
            name:'expectedSolutionDate',
            ellipsis: true,
          },
          {
            key: 'solutionDate',
            displayName: this.$t('reportTool.projectQuestion.solutionDate'),
            name:'solutionDate',
            ellipsis: true,
            dataIndex:'solutionDate',
          },
          {
            name:'dept',
            displayName: this.$t('reportTool.projectQuestion.dept'),
            key: 'dept',
            ellipsis: true,
            dataIndex:'dept',
          },
          {
            dataIndex:'changeDate',
            key: 'changeDate',
            ellipsis: true,
            displayName: this.$t('reportTool.projectQuestion.changeDate'),
            name:'changeDate',
          }
        ],
        //项目风险
        projectRisk:[
          {
            key: 'projectShortName',
            displayName: this.$t('reportTool.projectRisk.projectShortName'),
            dataIndex:'projectShortName',
            name:'projectShortName',
            url: true,
            scopedSlots: {
                customRender: "projectShortName",
              },
          },
          {
            dataIndex:'projectName',
            key: 'projectName',
            name:'projectName',
            displayName: this.$t('reportTool.projectRisk.projectName'),
            ellipsis: true,
          },
          {
            dataIndex:'projectRiskName',
            displayName: this.$t('reportTool.projectRisk.projectRiskName'),
            name:'projectRiskName',
            key: 'projectRiskName',
            ellipsis: true,
          },
          {
            key: 'riskStatus',
            name:'riskStatus',
            displayName: this.$t('reportTool.projectRisk.riskStatus'),
            dataIndex:'riskStatus',
            ellipsis: true,
          },
          {
            name:'createName',
            dataIndex:'createName',
            key: 'createName',
            ellipsis: true,
            displayName: this.$t('reportTool.projectRisk.createName'),
          },
          {
            name:'createNo',
            key: 'createNo',
            dataIndex:'createNo',
            displayName: this.$t('reportTool.projectRisk.createNo'),
            ellipsis: true,
          },
          {
            key: 'createDate',
            dataIndex:'createDate',
            name:'createDate',
            displayName: this.$t('reportTool.projectRisk.createDate'),
            ellipsis: true,
          },
          {
            name:'expectedSolutionDate',
            dataIndex:'expectedSolutionDate',
            key: 'expectedSolutionDate',
            ellipsis: true,
            displayName: this.$t('reportTool.projectRisk.expectedSolutionDate'),
          },
          {
            dataIndex:'solutionDate',
            key: 'solutionDate',
            ellipsis: true,
            displayName: this.$t('reportTool.projectRisk.solutionDate'),
            name:'solutionDate',
          },
          {
            dataIndex:'changeDate',
            key: 'changeDate',
            displayName: this.$t('reportTool.projectRisk.changeDate'),
            name:'solutionDate',
            ellipsis: true,
          }
        ],
        //规划项目
        planningProject:[
          {
            key: 'number',
            name:'number',
            dataIndex:'number',
            url: true,
            displayName: this.$t('reportTool.planningProject.number'),
            scopedSlots: { customRender: "number", },
          },
          {
            dataIndex:'groupName',
            key: 'groupName',
            ellipsis: true,
            displayName: this.$t('reportTool.planningProject.groupName'),
            name:'groupName',
          },
          {
            dataIndex:'institute',
            key: 'institute',
            name:'institute',
            displayName: this.$t('reportTool.planningProject.institute'),
            
            ellipsis: true,
          },
          {
            name:'product',
            dataIndex:'product',
            key: 'product',
            ellipsis: true,
            displayName: this.$t('reportTool.planningProject.product'),
          },
          {
            dataIndex:'year',
            key: 'year',
            ellipsis: true,
            displayName: this.$t('reportTool.planningProject.year'),
            name:'year',
          },
          {
            key: 'name',
            dataIndex:'name',
            name:'name',
            displayName: this.$t('reportTool.planningProject.name'),
            ellipsis: true,
          },
          {
            key: 'projectCategory',
            ellipsis: true,
            name:'projectCategory',
            displayName: this.$t('reportTool.planningProject.projectCategory'),
            dataIndex:'projectCategory',
          },
          {
            dataIndex:'importantGrade',
            key: 'importantGrade',
            displayName: this.$t('reportTool.planningProject.importantGrade'),
            name:'importantGrade',
            ellipsis: true,
          },
          {
            key: 'planTime',
            displayName: this.$t('reportTool.planningProject.planTime'),
            dataIndex:'planTime',
            name:'planTime',
            ellipsis: true,
          },
          {
            name:'projectShortName',
            displayName: this.$t('reportTool.planningProject.projectShortName'),
            dataIndex:'projectShortName',
            key: 'projectShortName',
            ellipsis: true,
          },
          {
            dataIndex:'projectName',
            displayName: this.$t('reportTool.planningProject.projectName'),
            name:'projectName',
            key: 'projectName',
            ellipsis: true,
          },
        ],
        //临时指标
        temporaryIndicators:[
          {
            name:'indexType',
            displayName: this.$t('reportTool.temporaryIndicators.indexType'),
            dataIndex:'indexType',
            key: 'indexType',
            url: true,
          },
          {
            key: 'indexName',
            displayName: this.$t('reportTool.temporaryIndicators.indexName'),
            dataIndex:'indexName',
            name:'indexName',
            ellipsis: true,
            scopedSlots: {
              customRender: "name",
            },
          },
          {
            key: 'indexUnit',
            displayName: this.$t('reportTool.temporaryIndicators.indexUnit'),
            dataIndex:'indexUnit',
            name:'indexUnit',
            ellipsis: true,
          },
          {
            name:'projectGroup',
            displayName: this.$t('reportTool.temporaryIndicators.projectGroup'),
            dataIndex:'projectGroup',
            key: 'projectGroup',
            ellipsis: true,
          },
          {
            dataIndex:'projectType',
            displayName: this.$t('reportTool.temporaryIndicators.projectType'),
            name:'projectType',
            key: 'projectType',
            ellipsis: true,
          },
          {
            name:'count',
            displayName: this.$t('reportTool.temporaryIndicators.count'),
            dataIndex:'count',
            key: 'count',
            ellipsis: true,
          }
        ],
        //项目节点
        projectNode:[
          {
            key: 'projectShortName',
            displayName: this.$t('reportTool.projectNode.projectShortName'),
            dataIndex:'projectShortName',
            name:'projectShortName',
            url: true,
            scopedSlots: {
              customRender: "name",
            },
          },
          {
            name:'importantGrade',
            key: 'importantGrade',
            ellipsis: true,
            displayName: this.$t('reportTool.projectNode.importantGrade'),
            dataIndex:'importantGrade',
          },
          {
            key: 'projectName',
            ellipsis: true,
            name:'projectName',
            displayName: this.$t('reportTool.projectNode.projectName'),
            dataIndex:'projectName',
          },
          {
            key: 'mainCategory',
            dataIndex:'mainCategory',
            name:'mainCategory',
            ellipsis: true,
            displayName: this.$t('reportTool.projectNode.mainCategory'),
          },
          {
            displayName: this.$t('reportTool.projectNode.projectSmallType'),
            dataIndex:'projectSmallType',
            key: 'projectSmallType',
            ellipsis: true,
            name:'projectSmallType',
          },
          {
            ellipsis: true,
            key: 'projectMananger',
            displayName: this.$t('reportTool.projectNode.projectMananger'),
            dataIndex:'projectMananger',
            name:'projectMananger',
          },
          {
            key: 'projectGroup',
            name:'projectGroup',
            displayName: this.$t('reportTool.projectNode.projectGroup'),
            dataIndex:'projectGroup',
            ellipsis: true,
          },
          {
            dataIndex:'projectKeyNode',
            displayName: this.$t('reportTool.projectNode.projectKeyNode'),
            name:'projectKeyNode',
            key: 'projectKeyNode',
            ellipsis: true,
          },
          {
            ellipsis: true,
            name:'projectKeyNodeTargetTime',
            displayName: this.$t('reportTool.projectNode.projectKeyNodeTargetTime'),
            dataIndex:'projectKeyNodeTargetTime',
            key: 'projectKeyNodeTargetTime',
          },
          {
            name:'projectKeyNodeActualTime',
            ellipsis: true,
            key: 'projectKeyNodeActualTime',
            displayName: this.$t('reportTool.projectNode.projectKeyNodeActualTime'),
            dataIndex:'projectKeyNodeActualTime',
          },
          {
            ellipsis: true,
            name:'projectKeyNodeState',
            displayName: this.$t('reportTool.projectNode.projectKeyNodeState'),
            dataIndex:'projectKeyNodeState',
            key: 'projectKeyNodeState',
          },
          {
            dataIndex:'projectFourthNodeTargetTime',
            ellipsis: true,
            name:'projectFourthNodeTargetTime',
            displayName: this.$t('reportTool.projectNode.projectFourthNodeTargetTime'),
            key: 'projectFourthNodeTargetTime',
          },
          {
            ellipsis: true,
            dataIndex:'projectFourthNodeActualTime',
            name:'projectFourthNodeActualTime',
            key: 'projectFourthNodeActualTime',
            displayName: this.$t('reportTool.projectNode.projectFourthNodeActualTime'),
          }
        ],
        //项目综合
        projectSynthesis:[
          {
            key: 'projectShortName',
            displayName: this.$t('reportTool.projectSynthesis.projectShortName'),
            dataIndex:'projectShortName',
            name:'projectShortName',
            ellipsis: true,
            scopedSlots: {
              customRender: "name"
            }
          },
          {
            dataIndex:'projectName',
            displayName: this.$t('reportTool.projectSynthesis.projectName'),
            name:'projectName',
            key: 'projectName',
            ellipsis: true,
          },
          {
            dataIndex:'projectType',
            displayName: this.$t('reportTool.projectSynthesis.projectType'),
            name:'projectType',
            key: 'projectType',
            ellipsis: true,
          },
          {
            name:'projectGroup',
            displayName: this.$t('reportTool.projectSynthesis.projectGroup'),
            dataIndex:'projectGroup',
            key: 'projectGroup',
            ellipsis: true,
          },
          {
            key: 'healthStatus',
            ellipsis: true,
            displayName: this.$t('reportTool.projectSynthesis.healthStatus'),
            dataIndex:'healthStatus',
            name:'healthStatus',
          },
          {
            key: 'planStartDate',
            dataIndex:'planStartDate',
            displayName: this.$t('reportTool.projectSynthesis.planStartDate'),
            name:'planStartDate',
            ellipsis: true,
          },
          {
            name:'planEndDate',
            key: 'planEndDate',
            ellipsis: true,
            dataIndex:'planEndDate',
            displayName: this.$t('reportTool.projectSynthesis.planEndDate'),
          },
          {
            ellipsis: true,
            name:'plannedDuration',
            displayName: this.$t('reportTool.projectSynthesis.plannedDuration'),
            dataIndex:'plannedDuration',
            key: 'plannedDuration',
          },
          {
            name:'actualStartDate',
            key: 'actualStartDate',
            displayName: this.$t('reportTool.projectSynthesis.actualStartDate'),
            dataIndex:'actualStartDate',
            ellipsis: true,
          },
          {
            key: 'actualEndDate',
            dataIndex:'actualEndDate',
            ellipsis: true,
            displayName: this.$t('reportTool.projectSynthesis.actualEndDate'),
            name:'actualEndDate',
          },
          {
            name:'actualDuration',
            dataIndex:'actualDuration',
            key: 'actualDuration',
            displayName: this.$t('reportTool.projectSynthesis.actualDuration'),
            ellipsis: true,
          },
          {
            key: 'issueTotalCount',
            ellipsis: true,
            displayName: this.$t('reportTool.projectSynthesis.issueTotalCount'),
            dataIndex:'issueTotalCount',
            name:'issueTotalCount',
            
          },
          {
            ellipsis: true,
            name:'issueClosedCount',
            dataIndex:'issueClosedCount',
            displayName: this.$t('reportTool.projectSynthesis.issueClosedCount'),
            key: 'issueClosedCount',
            
          },
          {
            ellipsis: true,
            dataIndex:'issueClosedRate',
            name:'issueClosedRate',
            key: 'issueClosedRate',
            displayName: this.$t('reportTool.projectSynthesis.issueClosedRate'),
          },
          {
            key: 'riskTotalCount',
            displayName: this.$t('reportTool.projectSynthesis.riskTotalCount'),
            dataIndex:'riskTotalCount',
            name:'riskTotalCount',
            ellipsis: true,
          },
          {
            displayName: this.$t('reportTool.projectSynthesis.riskClosedCount'),
            dataIndex:'riskClosedCount',
            name:'riskClosedCount',
            key: 'riskClosedCount',
            ellipsis: true,
          },
          {
            dataIndex:'riskClosedRate',
            key: 'riskClosedRate',
            name:'riskClosedRate',
            displayName: this.$t('reportTool.projectSynthesis.riskClosedRate'),
            ellipsis: true,
          },
          {
            name:'changeTotalCount',
            ellipsis: true,
            key: 'changeTotalCount',
            displayName: this.$t('reportTool.projectSynthesis.changeTotalCount'),
            dataIndex:'changeTotalCount',
          },
          {
            name:'lastChangeTime',
            key: 'lastChangeTime',
            dataIndex:'lastChangeTime',
            displayName: this.$t('reportTool.projectSynthesis.lastChangeTime'),
            ellipsis: true,
          },
          {
            key: 'targetCost',
            displayName: this.$t('reportTool.projectSynthesis.targetCost'),
            dataIndex:'targetCost',
            name:'targetCost',
            ellipsis: true,
          },
          {
            key: 'actualCost',
            dataIndex:'actualCost',
            name:'actualCost',
            ellipsis: true,
            displayName: this.$t('reportTool.projectSynthesis.actualCost'),
          },
        ],
        //设计返修
        designRepair:[
          {
            key: 'projectName',
            displayName:  this.$t('reportTool.designRepair.projectName'),
            dataIndex:'projectName',
            name:'projectName',
            ellipsis: true,
            scopedSlots: {
              customRender: "name"
            }
          },
          {
            name:'month',
            displayName: this.$t('reportTool.designRepair.month'),
            dataIndex:'month',
            key: 'month',
            url: true,
          },
          {
            displayName: this.$t('reportTool.designRepair.factory'),
            dataIndex:'factory',
            name:'factory',
            key: 'factory',
            ellipsis: true,
          },
          {
            name:'order',
            displayName: this.$t('reportTool.designRepair.order'),
            dataIndex:'order',
            key: 'order',
            ellipsis: true,
          },
          {
            key: 'description',
            dataIndex:'description',
            displayName: this.$t('reportTool.designRepair.description'),
            name:'description',
            ellipsis: true,
          },
          {
            ellipsis: true,
            key: 'expenses',
            displayName: this.$t('reportTool.designRepair.expenses'),
            dataIndex:'expenses',
            name:'expenses',
          },
          {
            key: 'department',
            displayName: this.$t('reportTool.designRepair.department'),
            name:'department',
            ellipsis: true,
            dataIndex:'department',
          },
          {
            name:'costType',
            key: 'costType',
            ellipsis: true,
            displayName: this.$t('reportTool.designRepair.costType'),
            dataIndex:'costType',
          },
          {
            dataIndex:'costDescription',
            displayName: this.$t('reportTool.designRepair.costDescription'),
            ellipsis: true,
            name:'costDescription',
            key: 'costDescription',
          },
          {
            dataIndex:'internalOrderNumber',
            displayName: this.$t('reportTool.designRepair.internalOrderNumber'),
            name:'internalOrderNumber',
            key: 'internalOrderNumber',
            width:160,
            ellipsis: true,
          },
          {
            displayName: this.$t('reportTool.designRepair.remarks'),
            dataIndex:'remarks',
            name:'remarks',
            key: 'remarks',
            ellipsis: true,
          },   
        ],
        //部门绩效
        departmentPerformance:[
          {
            key: 'projectShortName',
            displayName: this.$t('reportTool.departmentPerformance.projectShortName'),
            dataIndex:'projectShortName',
            name:'projectShortName',
            url: true,
            scopedSlots: {
                customRender: "name",
              },
          },
          {
            name:'resourceUserName',
            displayName: this.$t('reportTool.departmentPerformance.resourceUserName'),
            dataIndex:'resourceUserName',
            key: 'resourceUserName',
            url: true,
          },
          {
            dataIndex:'projectName',
            name:'projectName',
            key: 'projectName',
            displayName: this.$t('reportTool.departmentPerformance.projectName'),
            ellipsis: true,
          },
          {
            displayName: this.$t('reportTool.departmentPerformance.projectAbbreviation'),
            name:'projectAbbreviation',
            key: 'projectAbbreviation',
            dataIndex:'projectAbbreviation',
            ellipsis: true,
          },
          {
            name:'plannedWorkload',
            key: 'plannedWorkload',
            dataIndex:'plannedWorkload',
            displayName: this.$t('reportTool.departmentPerformance.plannedWorkload'),
            ellipsis: true,
          },
          {
            displayName: this.$t('reportTool.departmentPerformance.actualWorkload'),
            key: 'actualWorkload',
            ellipsis: true,
            dataIndex:'actualWorkload',
            name:'actualWorkload',
          },
          {
            key: 'completedTaskCount',
            dataIndex:'completedTaskCount',
            name:'completedTaskCount',
            ellipsis: true,
            displayName: this.$t('reportTool.departmentPerformance.completedTaskCount'),
          },
          {
            name:'closedIssueCount',
            dataIndex:'closedIssueCount',
            key: 'closedIssueCount',
            displayName: this.$t('reportTool.departmentPerformance.closedIssueCount'),
            ellipsis: true,
          },
          {
            ellipsis: true,
            dataIndex:'closedRiskCount',
            displayName: this.$t('reportTool.departmentPerformance.closedRiskCount'),
            name:'closedRiskCount',
            key: 'closedRiskCount',
          },
          {
            key: 'completedTaskRate',
            displayName: this.$t('reportTool.departmentPerformance.completedTaskRate'),
            name:'completedTaskRate',
            ellipsis: true,
            dataIndex:'completedTaskRate',
          },
          {
            dataIndex:'closedIssueRate',
            displayName: this.$t('reportTool.departmentPerformance.closedIssueRate'),
            key: 'closedIssueRate',
            ellipsis: true,
            name:'closedIssueRate',
          },
          {
            ellipsis: true,
            dataIndex:'closedRiskRate',
            name:'closedRiskRate',
            displayName: this.$t('reportTool.departmentPerformance.closedRiskRate'),
            key: 'closedRiskRate',
          },
          {
            key: 'averageComplatedRate',
            dataIndex:'averageComplatedRate',
            name:'averageComplatedRate',
            ellipsis: true,
            displayName: this.$t('reportTool.departmentPerformance.averageComplatedRate'),
          } 
        ],
        //项目变更
        projectChange:[
          {
            displayName: this.$t('reportTool.projectChange.requestNumber'),
            dataIndex:'requestNumber',
            name:'requestNumber',
            key: 'requestNumber',
            url: true,
            scopedSlots: {
              customRender: "name",
            },
          },
          {
            name:'requestName',
            displayName:  this.$t('reportTool.projectChange.requestName'),
            key: 'requestName',
            ellipsis: true,
            dataIndex:'requestName',
          },
          {
            key: 'projectName',
            name:'projectName',
            ellipsis: true,
            displayName:  this.$t('reportTool.projectChange.projectName'),
            dataIndex:'projectName',
          },
          {
            key: 'createStamp',
            name:'createStamp',
            displayName:  this.$t('reportTool.projectChange.createStamp'),
            ellipsis: true,
            dataIndex:'createStamp',
          },
          {
            name:'planActivityName',
            dataIndex:'planActivityName',
            key: 'planActivityName',
            displayName:  this.$t('reportTool.projectChange.planActivityName'),
            ellipsis: true,
          },
          {
            name:'responsibleUser',
            dataIndex:'responsibleUser',
            key: 'responsibleUser',
            displayName:  this.$t('reportTool.projectChange.responsibleUser'),
            ellipsis: true,
          },
          {
            name:'requestType',
            dataIndex:'requestType',
            key: 'requestType',
            displayName:  this.$t('reportTool.projectChange.requestType'),
            ellipsis: true,
          },
          {
            key: 'reasonForChange',
            displayName:  this.$t('reportTool.projectChange.reasonForChange'),
            ellipsis: true,
            dataIndex:'reasonForChange',
            name:'reasonForChange',
          },
          {
            dataIndex:'workflowNode',
            name:'workflowNode',
            displayName:  this.$t('reportTool.projectChange.workflowNode'),
            key: 'workflowNode',
            ellipsis: true,
          },
          {
            key: 'changeCreator',
            displayName:  this.$t('reportTool.projectChange.changeCreator'),
            name:'changeCreator',
            dataIndex:'changeCreator',
            ellipsis: true,
          },
          {
            ellipsis: true,
            dataIndex:'changeApprover',
            name:'changeApprover',
            key: 'changeApprover',
            displayName:  this.$t('reportTool.projectChange.changeApprover'),
          },
          {
            displayName:  this.$t('reportTool.projectChange.beforeChange'),
            name:'beforeChange',
            key: 'beforeChange',
            dataIndex:'beforeChange',
            ellipsis: true,
          },
          {
            key: 'afterChange',
            ellipsis: true,
            displayName:  this.$t('reportTool.projectChange.afterChange'),
            dataIndex:'afterChange',
            name:'afterChange',
          },
          {
            name:'changeResult',
            dataIndex:'changeResult',
            key: 'changeResult',
            ellipsis: true,
            displayName:  this.$t('reportTool.projectChange.changeResult'),
          }
        ],
        //项目质量
        projectQuality:[
          {
            name:'projectShortName',
            displayName: this.$t('reportTool.projectQuality.projectShortName'),
            dataIndex:'projectShortName',
            key: 'projectShortName',
            url: true,
            scopedSlots: {
              customRender: "name",
            },
          },
          {
            displayName: this.$t('reportTool.projectQuality.projectName'),
            dataIndex:'projectName',
            key: 'projectName',
            name:'projectName',
            ellipsis: true,
          },
          {
            dataIndex:'projectGroup',
            name:'projectGroup',
            key: 'projectGroup',
            displayName: this.$t('reportTool.projectQuality.projectGroup'),
            ellipsis: true,
          },
          {
            name:'projectManager',
            dataIndex:'projectManager',
            key: 'projectManager',
            ellipsis: true,
            displayName: this.$t('reportTool.projectQuality.projectManager'),
          },
          {
            name:'projectActivityName',
            ellipsis: true,
            displayName: this.$t('reportTool.projectQuality.projectActivityName'),
            dataIndex:'projectActivityName',
            key: 'projectActivityName',
          },
          {
            displayName: this.$t('reportTool.projectQuality.issueTotalCount'),
            key: 'issueTotalCount',
            ellipsis: true,
            dataIndex:'issueTotalCount',
            name:'issueTotalCount',
          },
          {
            ellipsis: true,
            dataIndex:'issueClosedCount',
            name:'issueClosedCount',
            displayName: this.$t('reportTool.projectQuality.issueClosedCount'),
            key: 'issueClosedCount',
          },
          {
            key: 'issueOpenCount',
            ellipsis: true,
            displayName: this.$t('reportTool.projectQuality.issueOpenCount'),
            dataIndex:'issueOpenCount',
            name:'issueOpenCount',
          },
          {
            displayName: this.$t('reportTool.projectQuality.issueOnTimeRate'),
            dataIndex:'issueOnTimeRate',
            name:'issueOnTimeRate',
            key: 'issueOnTimeRate',
            ellipsis: true,
          },
          {
            ellipsis: true,
            key: 'riskTotalCount',
            displayName: this.$t('reportTool.projectQuality.riskTotalCount'),
            dataIndex:'riskTotalCount',
            name:'riskTotalCount',
          },
          {
            name:'riskClosedCount',
            dataIndex:'riskClosedCount',
            displayName: this.$t('reportTool.projectQuality.riskClosedCount'),
            key: 'riskClosedCount',
            ellipsis: true,
          },
          {
            key: 'riskOpenCount',
            ellipsis: true,
            displayName: this.$t('reportTool.projectQuality.riskOpenCount'),
            dataIndex:'riskOpenCount',
            name:'riskOpenCount',
          },
          {
            name:'riskOnTimeRate',
            displayName: this.$t('reportTool.projectQuality.riskOnTimeRate'),
            key: 'riskOnTimeRate',
            ellipsis: true,
            dataIndex:'riskOnTimeRate',
          },
          {
            key: 'internalOrderNumber',
            dataIndex:'internalOrderNumber',
            name:'internalOrderNumber',
            ellipsis: true,
            displayName: this.$t('reportTool.projectQuality.internalOrderNumber'),
          },
          {
            dataIndex:'importantGrade',
            name:'importantGrade',
            displayName: this.$t('reportTool.projectQuality.importantGrade'),
            key: 'importantGrade',
            ellipsis: true,
          },
          {
            key: 'projectSmallType',
            ellipsis: true,
            displayName: this.$t('reportTool.projectQuality.projectSmallType'),
            dataIndex:'projectSmallType',
            name:'projectSmallType',
          },
          {
            name:'productCategory',
            key: 'productCategory',
            displayName: this.$t('reportTool.projectQuality.productCategory'),
            dataIndex:'productCategory',
            ellipsis: true,
          },
          {
            key: 'market',
            name:'market',
            displayName: this.$t('reportTool.projectQuality.market'),
            dataIndex:'market',
            ellipsis: true,
          },
          {
            key: 'priorityNum',
            displayName: this.$t('reportTool.projectQuality.priorityNum'),
            name:'priorityNum',
            ellipsis: true,
            dataIndex:'priorityNum',
          },
          {
            displayName: this.$t('reportTool.projectQuality.projectState'),
            dataIndex:'projectState',
            name:'projectState',
            key: 'projectState',
            ellipsis: true,
          },
        ],
        //项目指标详情
        projectIndexDetails:[
          {
            dataIndex:'projectShortName',
            displayName: this.$t('reportTool.projectIndexDetails.projectShortName'),
            key: 'projectShortName',
            url: true,
            name:'projectShortName',
            scopedSlots: {
              customRender: "name",
            },
          },
          {
            name:'projectName',
            key: 'projectName',
            displayName: this.$t('reportTool.projectIndexDetails.projectName'),
            dataIndex:'projectName',
            ellipsis: true,
          },
          {
            dataIndex:'projectGroup',
            name:'projectGroup',
            key: 'projectGroup',
            displayName: this.$t('reportTool.projectIndexDetails.projectGroup'),
            ellipsis: true,
          },
          {
            name:'projectType',
            key: 'projectType',
            displayName: this.$t('reportTool.projectIndexDetails.projectType'),
            dataIndex:'projectType',
            ellipsis: true,
          },
          {
            dataIndex:'importantGrade',
            name:'importantGrade',
            displayName: this.$t('reportTool.projectIndexDetails.importantGrade'),
            key: 'importantGrade',
            ellipsis: true,
          },
          {
            name:'projectMananger',
            displayName: this.$t('reportTool.projectIndexDetails.projectMananger'),
            dataIndex:'projectMananger',
            key: 'projectMananger',
            ellipsis: true,
          },
          {
            displayName: this.$t('reportTool.projectIndexDetails.projectState'),
            name:'projectState',
            dataIndex:'projectState',
            key: 'projectState',
            ellipsis: true,
          },
          {
            name:'indexType',
            displayName: this.$t('reportTool.projectIndexDetails.indexType'),
            dataIndex:'indexType',
            key: 'indexType',
            ellipsis: true,
          },
          {
            displayName: this.$t('reportTool.projectIndexDetails.indexName'),
            dataIndex:'indexName',
            name:'indexName',
            key: 'indexName',
            ellipsis: true,
          },
          {
            displayName: this.$t('reportTool.projectIndexDetails.indexUnit'),
            dataIndex:'indexUnit',
            name:'indexUnit',
            key: 'indexUnit',
            ellipsis: true,
          },
        ],
        //项目全节点
        projectFullNode:[
          {
            dataIndex:'user',
            displayName: '用户',
            key: 'user',
            url: true,
            name:'user',
            scopedSlots: {
              customRender: "user",
            },
          },
          {
            name:'reportTableName',
            key: 'reportTableName',
            displayName: '报表名称',
            dataIndex:'reportTableName',
            ellipsis: true,
          },
          {
            name:'parameter',
            key: 'parameter',
            displayName: '参数',
            dataIndex:'parameter',
            ellipsis: true,
          },
          {
            name:'executionStatus',
            key: 'executionStatus',
            displayName: '执行状态',
            dataIndex:'executionStatus',
            ellipsis: true,
          },
          {
            name:'download',
            key: 'download',
            displayName: '点击下载',
            dataIndex:'download',
            ellipsis: true,
             scopedSlots: {
              customRender: "download",
            },
          },
          {
            name:'submitTime',
            key: 'submitTime',
            displayName: '提交时间',
            dataIndex:'submitTime',
            ellipsis: true,
          },
          {
            name:'executionStartTime',
            key: 'executionStartTime',
            displayName: '执行开始时间',
            dataIndex:'executionStartTime',
            ellipsis: true,
          },
          {
            name:'executionEndTime',
            key: 'executionEndTime',
            displayName: '执行结束时间',
            dataIndex:'executionEndTime',
            ellipsis: true,
          }
        ]
      }];
    }
  },
  methods: {
    getNowFormatDate(val) {
      var date = new Date();
      var seperator1 = "/";
      var year = date.getFullYear();
      var month = date.getMonth() + 1;
      var strDate = date.getDate();
      if (month >= 1 && month <= 9) {
          month = "0" + month;
      }
      if (strDate >= 0 && strDate <= 9) {
          strDate = "0" + strDate;
      }
      var currentdate = ""
      if(val=='d'){
        currentdate = year + seperator1 + month + seperator1 + strDate;
      }else if(val=='m'){
        currentdate = year + seperator1 + month;
      }else if(val=='y'){
        currentdate = year;
      }
      return currentdate;
    },
    callback(key) {
      this.defaultTagId = key;
      this.tableData = [];
      this.setData();
    },
    setData() {
      this.columnsDataList = this.columnsData;
      // this.defaultTagName = this.lang === 'zh' ? this.tabPaneDataObj[this.defaultTagId].tagName : this.tabPaneDataObj[this.defaultTagId].tagEnName;
      this.defaultTagName = this.tabPaneDataObj[this.defaultTagId].tagName;
      this.filterData = this.tabPaneDataObj[this.defaultTagId].filterData;
      this.columnData = this.tabPaneDataObj[this.defaultTagId].columnData;
      this.columnWidth = this.tabPaneDataObj[this.defaultTagId].columnWidth;
      this.componentsName = this.tabPaneDataObj[this.defaultTagId].tagId;
      this.searchRes();
    },
    //搜索
    searchRes(rows,partList){
      // this.loading = true;
      let i = 1;
      // if(this.defaultTagName == '部门月度项目综合'){
      //   rows.map(item=>{
      //     if(!item.value || !item.value.length){
      //       i = 0;
      //       this.loading = false;
      //       this.$message.error(`请先选${item.name}`)
      //     }
      //   })
      // }
      rows = [{},{},{},{},{}] //后期删除
      if(i==1){
        if(this.defaultTagName == '部门月度项目综合'){
          this._getDepartmentList(rows[0].value,rows[1].value);
        }else if(this.defaultTagName == '项目问题'){
          this._getProjectIssueList(rows[0].value)
        }else if(this.defaultTagName == '项目风险'){
          this._getProjectRiskList(rows[0].value)
        }else if(this.defaultTagName == '临时指标'){
          this._getSpecificationIndexList(rows[0].value,rows[1].value,rows[2].value)
        }else if(this.defaultTagName == '项目节点'){
          this._getProjectNodesList(rows[0].value,rows[1].value,rows[2].value,rows[3].value)
        }else if(this.defaultTagName == '部门绩效'){
          this._getDepartmentalPerformanceList(rows[0].value,rows[1].value)
        }else if(this.defaultTagName == '项目变更'){
          this._getProjectChangeRequesList(rows[0].value,rows[1].value,rows[2].value,rows[3].value,rows[4].value)
        }else if(this.defaultTagName == '项目全节点'){
          this._getExportAllNodes(rows[0].value,rows[1].value,rows[2].value,rows[3].value)
        }else if(this.defaultTagName == '项目交付物'){
          this._getExportAllDelivers(rows[0].value,rows[1].value,rows[2].value,)
        }else if(this.defaultTagName == '规划项目'){
          this._getPlanningProjectList(rows[0].value,rows[1].value,rows[2].value,partList);
        }else if(this.defaultTagName == '项目综合'){
          this._getProjectConsolidatedList(rows[0].value,rows[1].value,rows[2].value,rows[3].value,rows[4].value);
        }else if(this.defaultTagName == '设计返修'){
          this._getProjectDesignRepairList(rows[0].value,rows[1].value,rows[2].value,rows[3].value,rows[4].value);
        }else if(this.defaultTagName == '项目质量'){
          this._getProjectQualityList(rows[0].value,rows[1].value,rows[2].value,rows[3].value,rows[4].value);
        }else if(this.defaultTagName == '项目指标详情'){
          this._getProjectIndexList(rows[0].value,rows[1].value,rows[2].value);
        }
      }
    },
    //导出
    outputData(rows){
      this.loading = true;
      let i = 1;
      if(this.defaultTagName == '部门月度项目综合'){
        rows.map(item=>{
          if(!item.value || !item.value.length){
            i = 0;
            this.loading = false;
            this.$message.error(`请先${item.name}`)
          }
        })
      }
      if(i==1){
        if(this.defaultTagName == '部门月度项目综合'){
          departmentMonthlyConsolidatedDownload({groupOid:this.filterData[0].value,month:this.filterData[1].value}).then(res=>{
            if (res && res.status === 200) {
              const blob = new Blob([res.data], {type: 'application/octet-stream'})
              // const blobUrl = window.URL.createObjectURL(blob)
              saveFile(blob, '部门月度项目综合.xlsx')
            } else {
              this.$message.warn('导出异常')
            }
            this.loading = false;
          })
        }else{
          let arr = [];
          this.$refs[this.componentsName].columns.map((item,index)=>{
            arr.push({
              name:item.name,
              num:index,
              title:item.displayName,
            })
          })
          exportList({titles : arr,projects: this.tableData}).then((res) => {
            if (res && res.status === 200) {
              const blob = new Blob([res.data], {type: 'application/octet-stream'})
              saveFile(blob, this.defaultTagName+'.xlsx')
              this.exportBtnStatus = false
            } else {
              this.exportBtnStatus = false
              this.$message.warn('导出异常')
            }
            this.loading = false;
          })
        }
      }
    },
    // 项目问题
    _getProjectIssueList(v1){
      this.tableData = tab1;
      return false;
      let params = {
        startDate: v1.length ? v1[0] : '',
        endDate: v1.length ? v1[1] : ''
      }
      this.loading = true;
      getProjectIssueList(params).then(res=>{
        if(res.data.success){
          console.log('项目问题：',res.data);
          this.tableData = res.data.data;
        }else{
          this.tableData = [];
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    // 项目风险
    _getProjectRiskList(v1){
      this.tableData = tab2;
      return false;
      let params = {
        startDate: v1.length ? v1[0] : '',
        endDate: v1.length ? v1[1] : ''
      }
      this.loading = true;
      getProjectRiskList(params).then(res=>{
        if(res.data.success){
          console.log('项目风险：',res.data);
          this.tableData = res.data.data;
        }else{
          this.tableData = [];
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    // 临时指标 
    _getSpecificationIndexList(v1,v2,v3){
        this.tableData = tab4;
        return false;
        let params = {
          projectTypeName: v1.toString(),
          groupOid: v3.toString(),
          indexType: v2.toString()
        }
        this.loading = true;
        getSpecificationIndexList(params).then(res=>{
          if(res.data.success){
            this.tableData = res.data.data.map((item,index)=>{
              item.oid = item.oid && item.oid.internalName ? item.oid.internalName : index.toString();
              return item;
            }) || [];
          }else{
            this.tableData = [];
          }
          this.loading = false;
        }).catch(()=>{
          this.loading = false;
        })
    },
    // 项目节点
    _getProjectNodesList(v1,v2,v3,v4){
      this.tableData = tab5;
      return false;
      let params = {
        projectTypeName: v1.toString(),
        groupOid: v3.toString(),
        projectSmallType: v2.toString(),
        activityStartDate: v4.length ? v4[0] : '',     
        activityEndDate: v4.length ? v4[1] : ''
      }
      this.loading = true;
      getProjectNodesList(params).then(res=>{
        if(res.data.success){
          console.log('项目节点：',res.data);
          this.tableData = res.data.data;
        }else{
          this.tableData = [];
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //部门绩效
    _getDepartmentalPerformanceList(v1,v2){
      this.tableData = tab9;
      return false;
      let params = {
        groupOid: v2.toString(),
        startDate: v1.length ? v1[0] : '',
        endDate:  v1.length ? v1[1] : ''
      }
      this.loading = true;
      getDepartmentalPerformanceList(params).then(res=>{
        if(res.data.success){
          console.log('部门绩效',res.data);
          this.tableData = res.data.data || [];
        }else{
          this.tableData = [];
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //部门月度项目综合
    _getDepartmentList(v1,v2){
      this.tableData = tab6.tableData;
      this.statistical = tab6.statistical;
      return false;
      this.loading = true;
      getDepartmentMonthlyConsolidatedList({groupOid:v1.toString(),month:v2}).then(res=>{
        if(res.data.success){
          this.tableData = res.data.data.tableData;
          this.statistical = res.data.data.statistical;
        }else{
          this.tableData = [];
          this.statistical = {};
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //获取规划项目报表 
    _getPlanningProjectList(v1,v2,v3){
      this.tableData = tab3;
      return false;
      this.loading = true;
      let params = {
          userId: userInfo.loginName,
          groupName: v1,
          institute: v2,
          year: v3
      }
      getPlanningProjectList(params).then(res=>{
        if(res.data.success){
          this.tableData = res.data.data;
          this.statistical = res.data.data.statistical;
        }else{
          this.tableData = [];
          this.statistical = {};
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //获取项目综合报表
    _getProjectConsolidatedList(v1,v2,v3,v4,v5){
      this.tableData = tab7;
      return false;
      this.loading = true;
      let params = {
        userId: userInfo.loginName,
        projectTypeName: v1.toString(),      //项目大类
        groupOid: v5.toString(),             //部门
        importantGrade: v2.toString(),       //重要等级
        state: v3.toString(),                //状态
        startDate: v4.length ? v4[0] : '',            //开始时间
        endDate:  v4.length ? v4[1] : ''               //结束时间
      }
      getProjectConsolidatedList(params).then(res=>{
        if(res.data.success){
          this.tableData = res.data.data;
        }else{
          this.tableData = [];
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //获取设计返修报表
    _getProjectDesignRepairList(v1,v2,v3,v4,v5){
      this.tableData = tab8;
      return false;
      this.loading = true;
      let params = {
        userId: userInfo.loginName,
        projectTypeName: v1.toString(),
        groupOid: v5.toString(),
        projectName: v2,
        state: v3.toString(),
        startDate: v4.length ? v4[0] : '',
        endDate: v4.length ? v4[1] : ''
      }
      getProjectDesignRepairList(params).then(res=>{
        if(res.data.success){
         // console.log(res.data);
          this.tableData = res.data.data;
          this.statistical = res.data.data.statistical;
        }else{
          this.tableData = [];
          this.statistical = {};
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //获取项目质量报表
    _getProjectQualityList(v1,v2,v3,v4,v5){
      this.tableData = tab11;
      return false;
      this.loading = true;
      let params = {
        userId: userInfo.loginName,
        projectTypeName: v1.toString(),
        groupOid: v5.toString(),
        importantGrade: v2.toString(),
        state: v3.toString(),
        /**hlu */
        startDate: v4.length ? v4[0] : '',
        endDate: v4.length ? v4[1] : ''
        // activityStartDate: v4.length ? v4[0] : '',
        // activityEndDate: v4.length ? v4[1] : ''
      }
      getProjectQualityList(params).then(res=>{
        if(res.data.success){
         // console.log(res.data);
          this.tableData = res.data.data;
          this.statistical = res.data.data.statistical;
        }else{
          this.tableData = [];
          this.statistical = {};
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //获取项目指标详情
    _getProjectIndexList(v1,v2,v3){
      this.tableData = tab12;
      return false;
      this.loading = true;
      let params = {
        userId: userInfo.loginName,
        projectTypeName: v1.toString(),
        groupOid: v3.toString(),
        startDate: v2.length ? v2[0] : '',
        endDate:  v2.length ? v2[1] : '',
      }
      getProjectIndexList(params).then(res=>{
        if(res.data.success){
          this.tableData = res.data.data;
          this.statistical = res.data.data.statistical;
        }else{
          this.tableData = [];
          this.statistical = {};
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //项目全节点
    _getExportAllNodes(v1,v2,v3,v4){
      exportAllNodes({projectTypeName:v1.toString(), projectName:v2,activityStartDate:v3.length ? v3[0] : '',activityEndDate:v3.length ? v3[1] : '',groupOid:v4.toString()}).then(res=>{
        this.loading = false;
        this.visible = true;
        this.msgRes = res.data.message;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //项目交付物
    _getExportAllDelivers(v1,v2,v3){
      exportAllDelivers({projectTypeName:v1.toString(), projectName:v2,groupOid:v3.toString()}).then(res=>{
        this.loading = false;
        this.visible = true;
        this.msgRes = res.data.message;
      }).catch(()=>{
        this.loading = false;
      })
    },
    //项目变更
    _getProjectChangeRequesList(v1,v2,v3,v4,v5){
      this.tableData = tab10;
      return false;
      this.loading = true;
      getProjectChangeRequesList({
        projectTypeName:v1.toString(),
        changeType:v2.toString(),
        /**hlu */
        // changeState:v3.toString(),
        // startDate:v4.length ? v4[0] : '',
        // endDate:v4.length ? v4[1] : '',
        state:v3.toString(),
        changeStartDate:v4.length ? v4[0] : '',
        changeEndDate:v4.length ? v4[1] : '',
        groupOid:v5.toString()
      }).then(res=>{
        if(res.data.success){
          this.tableData = res.data.data;
        }else{
          this.tableData = [];
        }
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      })
    }
  },
};
</script>
<style lang="less" scoped>
.report-tool-wrapper {
  padding: 20px;
  background: #fff;
  /deep/ .ant-tabs-nav .ant-tabs-tab {
    margin: 0;
    padding: 0px 20px 8px 20px;
    font-size: 14px;
  }
  .report-review {
    padding-top: 10px;
    color: #666;
    font-size: 14px;
    .title {
      color: #333;
    }
    .highlight {
      color: #386bd7;
    }
    > span {
      margin-right: 26px;
      &:nth-of-type(1),
      &:nth-last-of-type(1) {
        margin-right: 0;
      }
    }
  }
}
</style>
test4